<script type="text/javascript"> 
 
    $(document).ready(function(){ 
		// initialise Superfish 
        $("ul.sf-menu").superfish({ 
            pathClass:  'Contents' 
        }); 
    }); 
 
</script>

	Contents Items&nbsp;&nbsp;<a href="<?=APP_ROOT;?>/contents/add">Add new</a><br />
	<br />
	<table cellpadding="2" cellspacing="3" class="list">
		<thead>
			<td class = "listID"><a href="<?=APP_ROOT;?>/contents/index/orderBy:id<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'id') echo '/DESC:true';?>">ID</a></td>
			<td><a href="<?=APP_ROOT;?>/contents/index/orderBy:name<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'name') echo '/DESC:true';?>">Name</a></td>
			<td><a href="<?=APP_ROOT;?>/contents/index/orderBy:is_block<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'is_block') echo '/DESC:true';?>">Is contents / Is block</a></td>
			<td  class = "listAction">Action</td>
		</thead>
		<? 	
			$i = 0;
			foreach ($contents as $content){
				$i++;
				$id = $content['Content']['id'];
				$name = $content['Content']['name'];
				$is_block = $content['Content']['is_block'];
		?>
		<tr class="<?php if($i%2) echo 'zuyg'; else echo 'kent';  ?>">
			<td class = "listID">
				<? echo $id; ?>
			</td>
			<td>
				<a href="<?=APP_ROOT;?>/contents/edit/<?=$id?>"><? echo $name; ?></a>			</td>
			<td>
				<input type="radio" name="<? echo $id; ?>"  <? if (!$is_block) echo "checked" ?>  disabled="disabled" />
				&nbsp;&nbsp;<a href="<?=APP_ROOT;?>/contents/switchis_block/<? echo $id; ?>">Change</a>&nbsp;&nbsp;
				<input type="radio" name="<? echo $id; ?>"  <? if ($is_block) echo "checked" ?> disabled="disabled"  />
			</td>
			<td class = "listAction">
				<a title="preview" target="_blank" href="<?=APP_ROOT;?>/contents/view/<?=$id?>" ><img alt="asdf" src="<?=APP_ROOT;?>/img/icons/Colored/GIF/application.gif" /></a>
				<a title="edit" href="<?=APP_ROOT;?>/contents/edit/<?=$id?>" ><img src="<?=APP_ROOT;?>/img/icons/Colored/GIF/reply.gif" /></a>
				<a title="delete" onclick="javascript:del(<? echo $id; ?>)" href="#" ><img src="<?=APP_ROOT;?>/img/icons/Colored/GIF/action_delete.gif" /></a>
			</td>
		</tr>
		<?
		}//for main products
		?>
	</table>
<script language="javascript" type="text/javascript">
function del(id){
	if (confirm("Are you sure?")) {
    	window.location.href = "<?=APP_ROOT;?>/contents/delete/"+id;
	}
}
</script>